package com.eca.emas.daemon.shared;


import java.io.Serializable;
import java.util.ArrayList;

public class Location implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 3115707608315603774L;
	private int id;
	private String name;
	private String ip;
	private String address;
	private String comment;
	private String password;
	private ArrayList<SensorData> last250DataEntry;
	private String weatherImageURL;

	public Location(int id, String name, String ip,
			String address, String comment, String password) {
		this.id = id;
		this.name = name;
		this.ip = ip;
		this.address = address;
		this.comment = comment;
		this.password = password;
		last250DataEntry = new ArrayList<SensorData>();
	}
	
	public Location(){
		
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public ArrayList<SensorData> getLast250DataEntry() {
		return last250DataEntry;
	}

	public void setLast250DataEntry(ArrayList<SensorData> last250DataEntry) {
		this.last250DataEntry = last250DataEntry;
	}
	
	public String getWeatherImageURL() {
		return weatherImageURL;
	}
	
	public void setWeatherImageURL(String weatherImageURL) {
		this.weatherImageURL = weatherImageURL;
	}
	
	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public SensorData getLastDataEntry() {
		if (last250DataEntry != null) {
			if (!last250DataEntry.isEmpty()) {
				SensorData lastDataEntry = last250DataEntry.get(0);
				return lastDataEntry;
			} else {
				return null;
			}
		} else {
			return null;
		}
	}

}
